Skip to content

Add fuzz testing - #2

Merged
zemd merged 1 commit into
mainfrom
zemd/add-fuzz-testing
Aug 3, 2026
Merged

Add fuzz testing#2
zemd merged 1 commit into
mainfrom
zemd/add-fuzz-testing

Conversation

@zemd

@zemd zemd commented Aug 3, 2026

Copy link
Copy Markdown
Owner

This pull request introduces property-based fuzz testing to both the modals and slottable packages using the fast-check library. The main changes include adding fast-check as a dependency, updating lock and workspace files, and adding comprehensive property tests to ensure correctness and robustness of core APIs.

Testing improvements:

  • packages/modals/src/store.property.test.ts: Adds property-based fuzz tests for the modal store, simulating arbitrary sequences of stack operations and validating consistency, error handling, and stack capacity enforcement.
  • packages/slottable/src/use-slot.property.test.tsx: Adds property-based fuzz tests for the useSlot hook and Slot component, verifying prop precedence, slot name resolution, and default/override behavior under a wide range of input combinations.

Dependency updates:

  • packages/modals/package.json, packages/slottable/package.json: Adds fast-check as a test dependency. [1] [2]
  • pnpm-workspace.yaml, pnpm-lock.yaml: Updates workspace and lock files to include fast-check and its dependency pure-rand. [1] [2] [3] [4] [5] [6] [7] [8]

Summary by CodeRabbit

  • Tests
    • Added comprehensive property-based coverage for store behavior, including updates, removals, subscriptions, snapshots, notifications, errors, server rendering, and capacity limits.
    • Added property-based coverage for slot behavior, including prop precedence, fallbacks, overrides, and isolation.
  • Chores
    • Added the testing library required to support randomized test scenarios.

@zemd zemd self-assigned this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5213f0d9-c91d-4b92-9cc1-7ef5c5cf9614

📥 Commits

Reviewing files that changed from the base of the PR and between c4fb359 and 1846032.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/modals/package.json
  • packages/modals/src/store.property.test.ts
  • packages/slottable/package.json
  • packages/slottable/src/use-slot.property.test.tsx
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

The change adds fast-check to the workspace catalog and package development dependencies. It adds property-based tests for modal-store operations, capacity behavior, slot selection, prop precedence, fallback handling, and overrides.

Changes

Property-based testing

Layer / File(s) Summary
Modal store property coverage
pnpm-workspace.yaml, packages/modals/package.json, packages/modals/src/store.property.test.ts
Adds fast-check version 4.9.0 and randomized tests for store operations, snapshots, callbacks, notifications, server snapshots, error logging, and capacity limits.
Slottable property coverage
packages/slottable/package.json, packages/slottable/src/use-slot.property.test.tsx
Adds the fast-check development dependency and randomized tests for slot selection, prop precedence, fallback behavior, prop isolation, and default-versus-override resolution.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding property-based fuzz testing to the modals and slottable packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch zemd/add-fuzz-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedfast-check@​4.9.010010010089100

View full report

@zemd
zemd merged commit 6ea7c66 into main Aug 3, 2026
10 checks passed
@zemd
zemd deleted the zemd/add-fuzz-testing branch August 3, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant